﻿<%@ Page Title="" Language="C#" MasterPageFile="~/back/Site.master" AutoEventWireup="true"
    CodeFile="ViewUser.aspx.cs" Inherits="back_ViewUser" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <script src="../js/jquery-1.8.1.min.js" type="text/javascript"> </script>
    <script src="../js/bootstrap-modal.js" type="text/javascript"></script>
    <script type="text/javascript">
        function lanchPopUp(userId) {
            $("#MainContent_drpMode").val('');
            $("#MainContent_txtAmount").val('');

            $("#MainContent_lblUserId").val(userId);
            $("#myModal").modal('show');
        }
    </script>
    <div class="page-header">
        <h1>
            View Users</h1>
    </div>
    <div id="divRed" runat="server">
    </div>
    <div id="divGreen" runat="server">
    </div>
    <asp:GridView ID="grdUser" runat="server" AutoGenerateColumns="False" Width="100%"
        CssClass="table table-striped table-bordered" OnRowDataBound="grdUser_RowDataBound"
        OnRowCommand="grdUser_RowCommand" PageSize="50" OnPageIndexChanging="grdUser_PageIndexChanging"
        AllowPaging="true">
        <Columns>
            <asp:TemplateField HeaderText="First Name">
                <ItemTemplate>
                    <asp:Label ID="hdnUserId" Style="display: none;" runat="server" Text='<%#Eval("Id") %>'></asp:Label>
                    <asp:Label ID="lblFirstName" runat="server" Text='<%# Eval("FirstName") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Last Name">
                <ItemTemplate>
                    <asp:Label ID="lblLastName" runat="server" Text='<%#Eval("LastName") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Email">
                <ItemTemplate>
                    <asp:Label ID="lblEmail" runat="server" Text='<%#Eval("Email") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Address 1">
                <ItemTemplate>
                    <asp:Label ID="lblAddress1" runat="server" Text='<%#Eval("Address1") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Address 2">
                <ItemTemplate>
                    <asp:Label ID="lblPhone" runat="server" Text='<%#Eval("Address2") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="City">
                <ItemTemplate>
                    <asp:Label ID="lblCity" runat="server" Text='<%#Eval("City") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Actions">
                <ItemTemplate>
                    <asp:Button ID="btnPayment" runat="server" CssClass="btn btn-info" Text="Payment Details"
                        CommandName="MakePayment" Visible="false" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnEdit" runat="server" CssClass="btn btn-info" Text="Edit" CommandName="EditMenu"
                        OnClientClick="return confirm('Do you want to edit this content?')" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnDelete" runat="server" CssClass="btn btn-danger" Text="Delete"
                        CommandName="DeleteMenu" OnClientClick="return confirm('Do you want to delete this content?')" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <PagerSettings Position="TopAndBottom" />
        <PagerStyle CssClass="pagination" />
    </asp:GridView>
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
        aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;</button>
                    <h4 class="modal-title">
                        Payment History</h4>
                </div>
                <div class="modal-body">
                    <div id="dvMessage" style="color: Red;" runat="server">
                    </div>
                    <center>
                        <table>
                            <tr>
                                <td>
                                    Payment Mode
                                </td>
                                <td>
                                    <asp:DropDownList ID="drpMode" runat="server">
                                        <asp:ListItem Text="Select Payment Mode" Value=""></asp:ListItem>
                                        <asp:ListItem Text="Cheque" Value="Cheque"></asp:ListItem>
                                        <asp:ListItem Text="Wire Transfer" Value="Wire Transfer"></asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator ID="rqvMode" runat="server" ControlToValidate="drpMode" InitialValue="" ErrorMessage="*"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Amount
                                </td>
                                <td>
                                    <asp:TextBox ID="txtAmount" runat="server"></asp:TextBox>
                                    <asp:RegularExpressionValidator ID="revAmount" runat="server" ErrorMessage="*" ControlToValidate="txtAmount"
                                    Display="Dynamic" ValidationExpression="\d+"></asp:RegularExpressionValidator>
                                    <asp:RequiredFieldValidator ID="rqvAmount" runat="server" ControlToValidate="txtAmount" ErrorMessage="*"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    
                                </td>
                                <td>
                                    <asp:Button ID="btnSubmit" runat="server" CssClass="btn btn-info" Text="Submit" 
                                        onclick="btnSubmit_Click" />
                                </td>
                            </tr>
                        </table>
                        <hr />
                        <asp:TextBox ID="lblUserId" runat="server" style="display:none;"></asp:TextBox>
                        
                    </center>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
